c PROGRAM sequential input list to i * j array c ------------------------------------------------------------------ c Program will ignore all lines beginning with character c. c c Convert a list form to an array 10 * i long. c where i = total number of lines / 10 c e.g. 6385 lines long will give i = 639 c 6385 = 10 * 639 c If you work in DOS it all hinges on the 64K memory segment boundary c so you may need to alter the file. c c ------------------------------------------------------------------ integer i, j, k character*9 word, arai(639,10) c Alter ? in character*? to num. of characters per line in input.txt open(1, file='input.dat') open(2, file='output.dat') print*,'Beginning processing' c i is the number lines on the resultant output.txt file do 10 i = 1,639 c j is the number of entries per line from input.txt in ouput.txt do 20 j = 1,10 k = k + 1 read(1,5)word arai(i,j) = word 20 continue c add or remove the arai(i,*) as needed. Here there are 10 in the c array so arai(i,*) appears 10 times. * = 1, 2, ..... write(2,15)arai(i,1),arai(i,2),arai(i,3),arai(i,4),arai(i,5),arai( +i,6),arai(i,7),arai(i,8),arai(i,9),arai(i,10) 10 continue close(2) close(1) print*,'Processing complete' 5 format(a) c You can also alter 15 format(a.....) by adding or removing a to c the number of entries per line j. since j = 10 there are 10 a's. 15 format(a,a,a,a,a,a,a,a,a,a) end